package com.matace.keychain.presentation.viewmodel;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
import com.matace.keychain.domain.MainPageUseCase;

public class MainViewModel extends ViewModel {
    private final MutableLiveData<String> navigationMessage = new MutableLiveData<>();
    private final MainPageUseCase mainPageUseCase;

    public MainViewModel(MainPageUseCase mainPageUseCase) {
        this.mainPageUseCase = mainPageUseCase;
    }

    public LiveData<String> getNavigationMessage() {
        return navigationMessage;
    }

    public boolean handleNavigationItemSelected(int itemId) {
        String message = mainPageUseCase.getNavigationMessage(itemId);
        if (!message.isEmpty()) {
            navigationMessage.setValue(message);
            return true;
        }
        return false;
    }
}